class Task:
    def __init__(self, name, priority):
        self.name = name
        self.priority = priority  # 优先级：1（高）→3（低）

def process_tasks(tasks):
    """
    队列处理优先级任务：高优先级任务先处理
    tasks：Task对象列表
    """
    from collections import deque
    # 按优先级分组：高优先级队列（priority=1）、普通队列（priority≥2）
    high_queue = deque()
    normal_queue = deque()
    for task in tasks:
        if task.priority == 1:
            high_queue.append(task)
        else:
            normal_queue.append(task)
    # 先处理高优先级队列，再处理普通队列
    result = []
    while high_queue:
        result.append(high_queue.popleft().name)
    while normal_queue:
        result.append(normal_queue.popleft().name)
    return result

# 测试
tasks = [Task("Task1", 2), Task("Task2", 1), Task("Task3", 1), Task("Task4", 3)]
print([t for t in process_tasks(tasks)])  # 输出：['Task2', 'Task3', 'Task1', 'Task4']